package com.example.demo.controller;

import com.example.demo.model.V1Answer;
import com.example.demo.service.V1Service;
import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;
import lombok.experimental.FieldDefaults;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api")
@RequiredArgsConstructor
@FieldDefaults(level= AccessLevel.PRIVATE, makeFinal=true)
public class V1Controller {

    V1Service v1Service;

    @GetMapping("/hello")
    public V1Answer hello(){
        return new V1Answer(v1Service.hello());
    }
}
